Creating topics from CSV or Excel files
With the Topic Creator tools you can create topics, snippets, or other XML files from a different data sources. This lets you maintain data in, for example, Excel, and then create the topics using a template file.
Set up a template file
You can set up a template in any valid XML-file, for example, topic files (.htm), snippet files (.flsnp), or even target files (.fltar).
Set up a template that creates one file per line
-
Create a new file in Flare.
-
Open the file in, e.g. Notepad++.
-
Use the headers from your data file where you want to import the data. For example, if your Excel file has two columns, Title and Description - you could set up a template like this:
<?xml version="1.0" encoding="utf-8"?>
<html>
<body>
<h1>[[Title]]</h1>
<p>[[Description]]</p>
</body>
</html>
Sample CSV data
Title;Description
Title A;Description A
Title B;Description B
Templates with repeating patterns
If your data is hierarchical, for example like this,
Title | Data A | Data B | Data C |
---|---|---|---|
Lorem A | Lorem 1 | Lorem 2 | Lorem 3 |
Lorem A | Lorem 1.1 | Lorem 2.1 | Lorem 3.1 |
Lorem A | Lorem 1.2 | Lorem 2.2 | Lorem 3.2 |
, you can set up a template with a repeating pattern, where the headers inside the <div class="repeat" >
are repeated while the other headers stay the same. The example would result in two files each containing a table.
<?xml version="1.0" encoding="utf-8"?>
<html>
<body>
<h1><[[Title]]/h2>
<div class="repeat">
<table>
<th>
<td>Data A</td>
<td>Data B</td>
<td>Data C</td>
</th>
<tr>
<td>[[Data A]]</td>
<td>[[Data B]]</td>
<td>[[Data C]]</td>
</tr>
</table>
</div>
</body>
</html>
Import data from a CSV file
Note that the CSV file must have a header row.
- Click Data Import (CSV).
- Select the path to the CSV file.
- Select the path to the template file.
- Select the folder where you want the output files.
- To overwrite any existing files, select the Overwrite files checkbox.
- To generate the files, click Execute.
Sample CSV data
Title;Description Title A;Description A Title B;Description B
Import data from an Excel file
Note that the Excel file must have a header row.
- Click Data Import (Excel).
- Select the path to the Excel file.
- Select the path to the template file.
- Select the folder where you want the output files.
- To overwrite any existing files, select the Overwrite files checkbox.
- To generate the files, click Execute.